<template>
  <div class="index">
    <el-header style="height: 60px; line-height:60px">
      <el-row :gutter="20">
        <el-col :span="3">
          <img
            @click="toHome"
            src="https://sanghongxv.gitee.io/img/avatar-hux.jpg"
            style=" height:45px;float:right;padding-top: 10px;"
          >
        </el-col>
        <el-col :span="8">
          <el-menu
            :default-active="activeIndex"
            class="el-menu-demo"
            mode="horizontal"
            @select="handleSelect"
          >
            <el-menu-item index="1">首页</el-menu-item>
            <el-submenu index="2">
              <template slot="title">书库分类</template>
              <el-menu-item index="2-1">选项1</el-menu-item>
              <el-menu-item index="2-2">选项2</el-menu-item>
              <el-menu-item index="2-3">选项3</el-menu-item>
            </el-submenu>
            <el-menu-item index="3">消息中心</el-menu-item>
            <el-menu-item index="4">订单管理</el-menu-item>
          </el-menu>
        </el-col>
        <el-col :span="5">
          <el-input placeholder="请输入内容" v-model="vlaue">
            <el-button slot="append" icon="el-icon-search" @click="search"></el-button>
          </el-input>
        </el-col>
        <el-col :span="2">
          <el-button icon="el-icon-edit" type="primary" plain>发布</el-button>
        </el-col>
      </el-row>
    </el-header>
    <router-view/>
    <Homefood></Homefood>
  </div>
</template>
<script>
import Homefood from "../components/food.vue";
export default {
  name: "index",
  components: {
    Homefood
  },
  data() {
    return {
      data: {},
      vlaue: "",
      isActive: false,
      list: [],
      activeIndex: "1"
    };
  },
  methods: {
    search() {
      this.$router.push({
        path: "seachVue",
        query: {
          vlaue: this.vlaue
        }
      });
    },
    handleSelect(key, keyPath) {
      console.log(key, keyPath);
    },
    toHome() {
      this.$router.push({ path: "/" });
    }
  },
  mounted() {
  }
};
</script>
<style>
.el-carousel__item h3 {
  color: #475669;
  font-size: 18px;
  opacity: 0.75;
  line-height: 300px;
  margin: 0;
}
.el-carousel {
  padding: 15px 120px;
  margin-top: 10px;
  background-color: #ffffff;
  margin-bottom: 10px;
}

.el-carousel__item:nth-child(2n) {
  background-color: #99a9bf;
}

.el-carousel__item:nth-child(2n + 1) {
  background-color: #d3dce6;
}
.grid-content {
  border-radius: 5px;
  min-height: 36px;
}
.Middletitle {
  background-color: #ffffff;
  margin: 0px 120px;
  height: 70px;
  border-radius: 5px;
  line-height: 70px;
  text-align: center;
}
.buttonDiv {
  /* background-color: #ffffff; */
  margin: 10px 120px;
}
.contentDiv {
  margin: 10px 120px;
  /* 转化元素类型 */
  display: grid;
  /* 设置网格的间隙 */
  grid-gap: 10px;
  /* 4 列  */
  grid-template-columns: repeat(5, 1fr);
}
.content {
  min-height: 260px;
  border-radius: 5px;
  background-color: #ffffff;
}
.contentImg {
  border-radius: 5px 5px 0 0;
  max-height: 230px; 
  height: 230px;
  width: 100%;
  overflow: hidden;
}
.contentImg::-webkit-scrollbar {
  /*隐藏滚轮*/
  display: none;
}
.contentButtom {
  width: 100%;
  /* margin: 0; */
  margin: 0;
  min-height: 80px;
  text-overflow: ellipsis;
}
.contentTitle {
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  font-size: 15px;
  font-weight: normal;
  padding: 5px;
}
.headIcon {
  width: 30px;
  height: 30px;
  margin-top: -10px;
  margin-bottom: 10px;
  border-radius: 50%;
  float: left;
  margin-right: 5px;
}
.name {
  font-size: 13px;
}
.divborder {
  margin-top: -10px;
}
a:hover {
  color: #ff0000;
}
a {
  text-decoration: none;
  color: #000;
}
.el-header {
  background-color: f7f7f7;
  color: #333;
  background-color: #ffffff;
}
</style>

